/*
 * Created by SharpDevelop.
 * User: Vivek
 * Date: 9/5/2009
 * Time: 10:54 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.IO;
namespace GxcToCsharpParser.GxcParser.Translator
{
	/// <summary>
	/// Description of GxcGUILogicTranslator.
	/// </summary>
	public class GxcGUILogicTranslator
	{
		private int lineNumbers;
		public GxcGUILogicTranslator()
		{
		}
		public void Parse(string uiFile)
		{
			
			if(File.Exists(uiFile))
			   {
			   	string line;
			   	lineNumbers=0;
			   	using(StreamReader reader = new StreamReader(uiFile))
			   	{
			   		while(!reader.EndOfStream)
			   		{
			   			line = reader.ReadLine();
			   			lineNumbers++;
			   			string trimedLine = line.Trim();
			   			if(trimedLine.StartsWith("//"))
			   			   continue;
			   			if(trimedLine.Contains("Create_DWG"))
			   			   MarkDialogCreation(trimedLine);
			   			 if(trimedLine.Contains("iInteractive_SYS"))
			   			 	MarkInterActiveSection(trimedLine);
			   			 if(trimedLine.Contains("if"))
			   			 	MarkIfSection(trimedLine);
			   			   	
			   			      
			   			   
			   			   
			   			
			   		}
			   	}
			   }
		}
		public void MarkDialogCreation(string line)
		{
			System.Diagnostics.Trace.TraceInformation( "{0}:{1}",lineNumbers,line);
		}
		public void MarkInterActiveSection(string line)
		{
			System.Diagnostics.Trace.TraceInformation("{0}:{1}",lineNumbers,line);
		}
		public void MarkIfSection(string line)
		{
			System.Diagnostics.Trace.TraceInformation("{0}:{1}",lineNumbers,line);
		}
	}
}
